<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let num = parseInt(prompt("请输入一个三位数字"));
        let a = parseInt(num / 100);
        let b = parseInt((num / 10) % 10);
        let c = parseInt(num % 10);
        if (num == a * a * a + b * b * b + c * c * c) {
            alert(`${num}是水仙花数`);
        } else {
            alert(`${num}不是水仙花数`);
        }
    </script>
</body>

</html>